package com.fusetech.flow.audit.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fusetech.flow.audit.domain.AuditNodeAuditor;
import com.fusetech.flow.audit.mapper.AuditNodeAuditorMapper;
import com.fusetech.flow.audit.service.dto.AuditNodeAuditorDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * 审核节点对应发起人员表Service
 * @author Liuwq
 * @version 2023-05-08
 */
//@DS("zxhy_platform_db")
@Service
@Transactional
public class AuditNodeAuditorService extends ServiceImpl<AuditNodeAuditorMapper, AuditNodeAuditor> {

	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public AuditNodeAuditorDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage <AuditNodeAuditorDTO> findPage(Page <AuditNodeAuditorDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper);
	}

	/**
	 * 通过节点id删除节点授权人员
	 *
	 * @param id id
	 * @return int
	 */
	public int deleteNodeAuditorByNodeID(String id)
	{
		return baseMapper.deleteNodeAuditorByNodeID(id);
	}

}
